package com.javandad.app.client.cells;

import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.javandad.app.shared.entity.home.HomePost;

public class HomePostCell extends AbstractCell<HomePost> {

	@Override
	public void render(com.google.gwt.cell.client.Cell.Context context, HomePost value, SafeHtmlBuilder sb) {

		sb.appendHtmlConstant("<p><table align='left' border=0 bgcolor='white' width='100%'><tr align='left' width='100%'><td><table border=0><tr ><td><img width='64' height='64' src='"
				+ value.getPosterObj().getProfileFodoURL() + "'></img></td></tr></table></td>");
		sb.appendHtmlConstant("<td width='100%' valign='top' align='left'><table width='100%' height='100%'><tr valign='top' height='10%'><td width='100%'><b>");
		sb.appendEscaped(value.getPoster());
		sb.appendHtmlConstant("</b></td></tr>");
		sb.appendHtmlConstant("<tr valign='top' width='100%' height='85%'><td>");

		sb.appendEscaped(value.getContent());
		sb.appendHtmlConstant("</td></tr><tr height='5%' valign='bottom'><td width='100%'>");
		sb.appendEscaped("posted at " + value.getDateOfPost());
		sb.appendHtmlConstant("</td></tr></table></td></tr></table></p>");

	}

}
